/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-11-24 23:34:52
 * Copyright (c) 2015- joysuch-版权所有
 */

package com.joysuch.wwyt.bp.service;

import com.joysuch.wwyt.bp.bean.BpDeviceFacilityInspectRecordBean;
import com.joysuch.wwyt.bp.bean.MhBindPointBean;
import com.joysuch.wwyt.bp.bean.facility.BpProductionAddBean;
import com.joysuch.wwyt.bp.bean.facility.BpProductionFacilityListBean;
import com.joysuch.wwyt.bp.bean.facility.BpProductionFacilityScrapBean;
import com.joysuch.wwyt.bp.bean.facility.BpProductionSearchBean;
import com.joysuch.wwyt.bp.entity.BpDeviceFacilityMaintainRecord;
import com.joysuch.wwyt.bp.entity.BpProductionFacility;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Date;
import java.util.List;

public interface BpProductionFacilityService {

    public BpProductionFacility add(BpProductionAddBean entity);

    BpProductionFacility update(BpProductionAddBean entity);

    Page<BpProductionFacilityListBean> findByPage(Pageable page, BpProductionSearchBean bpProductionSearchBean);

    void delete(Long id);

    BpProductionFacilityListBean findById(Long id);

    void save(BpProductionFacility bpProductionFacility);

    public void scrapFacility(BpProductionFacilityScrapBean bean);

    public BpProductionFacilityScrapBean getScrapInfo(Long id);

    /**
     * @param bean
     * @param flag         0 绑定 新增  1修改
     * @param bindPointIds 绑定的监测点
     * @return
     */
    public String bindMonitorPoint(MhBindPointBean bean, Integer flag, List<Long> bindPointIds);

    public void unbindMonitorPoint(Long id, Long monitorPointId);

    public com.baomidou.mybatisplus.extension.plugins.pagination.Page<BpDeviceFacilityInspectRecordBean> findInspectRecordPage(Pageable page, Long deviceFacilityId);

    public BpProductionFacility findByCode(String code, String companyCode);

    BpProductionFacility findByCodeAndCompanyCode(String code, String companyCode);

    void notify(String deviceName, Long id, Long typeId, Date validityDate);

    void remindNotify(String deviceName, Long id, Long recordId, Long typeId, Date notifyDate, Date checkValidDate, String notifyType, String messageSource);

    void removeNotify(Long id);

    void deleteByIds(List<Long> ids);

    void removeRemindNotify(Long id, String type);

    /**
     * 查询设备装置数量
     * @param flag 0 : 所有数量 1: 拥有位置的数量
     * @return
     */
    Long getNumForHaveLocation(Integer flag);

    /**
     * 查询所有拥有位置的设备
     * @return
     */
    List<BpProductionFacility> findAllHaveLocation();

    /**
     * 查询设备状态
     * @param deviceId 设备id
     * @return 设备状态
     */
    BpProductionFacility findOne(Long deviceId);

}
